﻿@using Smart.Project.Data
@model MUser
@{
    Layout = null;
}
<link href="~/Content/css/styles.css" rel="stylesheet" />
<link href="~/Content/css/styles-blue.css" rel="stylesheet" />
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/css/new-styles.css" rel="stylesheet" />
<link href="~/Content/js/vendors/jsPanel/jquery.jspanel.css" rel="stylesheet" />
<script src="~/Content/js/vendors/jquery/jquery.min.js"></script>
<script src="~/Content/js/vendors/jquery/jquery-ui.min.js"></script>
<script src="~/Content/js/vendors/bootstrap/bootstrap.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.form.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.validate.min.js"></script>
<script src="~/Content/js/vendors/slimScroll/jquery.slimscroll.min.js"></script>
<script src="~/Content/js/index.js"></script>
<script src="~/Content/js/vendors/jsPanel/jquery.jspanel.js"></script>
<script type="text/javascript">
    $(function () {
        $("#slimScroll").slimScroll({
            height: "500px",
        });
        $.validator.addMethod("isPhone", function (value, element) {
            var length = value.length;
            var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
            return this.optional(element) || (length == 11 && mobile.test(value));
        }, "请填写正确的手机号码");//可以自定义默认提示信息
        $("#btnSave").click(function () {
            if ($("#mainForm").valid()) {
                $('#mainForm').ajaxSubmit(function (data) {
                    if (data == "true") {
                        parent.AlertInfo("添加成功！", "success");
                    } else {
                        parent.AlertInfo("添加失败！", "error");
                    }
                });
            }
        });
        /*查看部门帮助*/
        $("#btnDEPTID").click(function () {
            //function DEPTView() {
            var parturl = path + "User/DetailHelp";
            ProInfo = $.jsPanel({
                resizable: "disabled",
                id: 'View',
                headerTitle: "部门信息帮助",
                content: '<iframe src="' + parturl + '" width="100%" height="100%" frameborder="0" />',
                position: 'center',
                contentSize: { width: 850, height: 400 },
                contentOverflow: 'hidden',
                theme: '#31435e',
                headerControls: {
                    controls: 'closeonly'
                }
            });
            //}
        });
        /*查看角色帮助*/
        $("#btnROLEID").click(function () {
            //function DEPTView() {
            var parturl = path + "User/RoleHelp";
            ProInfo = $.jsPanel({
                resizable: "disabled",
                id: 'View',
                headerTitle: "角色信息帮助",
                content: '<iframe src="' + parturl + '" width="100%" height="100%" frameborder="0" />',
                position: 'center',
                contentSize: { width: 850, height: 400 },
                contentOverflow: 'hidden',
                theme: '#31435e',
                headerControls: {
                    controls: 'closeonly'
                }
            });
            //}
        });
    });
</script>
<div class="powerwidget" data-widget-editbutton="false" style="margin-bottom:0px">
    <div class="inner-spacer">
        <div id="slimScroll">
            @using (Html.BeginForm("Create", "User", FormMethod.Post, new { @class = "form-horizontal", @id = "mainForm", @style = "margin-bottom:0px" }))
            {
                <fieldset>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">用户账号</label>
                        <div class="col-xs-10">
                            @Html.HiddenFor(item => item.Id)
                            @Html.TextBoxFor(item => item.USERCODE, new { @class = "form-control required", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">用户名</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.USERNAME, new { @class = "form-control required", @id = "name", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">用户密码</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.USERPWD, new { @class = "form-control required", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">手机</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.PHONEIMEI, new { @class = "form-control isPhone", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">部门</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.BMMC, new { @class = "form-control", @id = "BMMC", @readonly = "readonly" })
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">用户角色</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.ROLE.ROLENAME, new { @class = "form-control", @id = "ROLENAME", @readonly = "readonly" })
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">性别</label>
                        <div class="col-xs-10">
                            <select id="SEX" name="SEX" class="form-control" disabled="disabled">
                                <option value="男" selected="selected">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">是否禁用</label>
                        <div class="col-xs-10">
                            <select id="DISABLED" name="DISABLED" class="form-control" disabled="disabled">
                                <option value="1" selected="selected">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">备注</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.BZ, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>
                </fieldset>
            }
        </div>
    </div>
</div>


